#ifndef QMYTIMEEDIT_H
#define QMYTIMEEDIT_H

#include "../../lib/shared/qobjecthost.h"

#include <QTimeEdit>
#include <QDateEdit>
#include <QDateTimeEdit>

#include <QTimer>

class QTimeEditHost: public QObjectHost
{
    Q_OBJECT
public:
    QTimeEditHost(QWidget* wid);
public slots:
    int     hour();
    int     minute();
    int     second();
    void    setTime(int hour,int minute,int second);
};

class QMyTimeEdit : public QTimeEdit
{
    Q_OBJECT
public:
    QMyTimeEdit(QWidget* parent=0);
public slots:
    void    updateProperty(const QString & name);
    void    timer();
    void    updatePropertyAttribute();

    void    timeChanged_signals(const QTime &time);
    void    initProperty();
signals:
    void    zValueChanged();
protected:
    QTimer  *m_timer;
    QObjectHost   *m_host;
};


class QDateEditHost: public QObjectHost
{
    Q_OBJECT
public:
    QDateEditHost(QWidget* wid);
public slots:
    int     year();
    int     month();
    int     day();
    void    setDate(int year,int month,int day);
};

class QMyDateEdit : public QDateEdit
{
    Q_OBJECT
public:
    QMyDateEdit(QWidget* parent=0);
public slots:
    void    updateProperty(const QString & name);
    void    timer();
    void    updatePropertyAttribute();
    void    dateChanged_signals(const QDate &date);
    void    initProperty();
signals:
    void    zValueChanged();
protected:
    QTimer  *m_timer;
    QObjectHost   *m_host;
};


class QDateTimeEditHost: public QObjectHost
{
    Q_OBJECT
public:
    QDateTimeEditHost(QWidget* wid);
public slots:
    int     hour();
    int     minute();
    int     second();
    void    setTime(int hour,int minute,int second);
    int     year();
    int     month();
    int     day();
    void    setDate(int year,int month,int day);
    void    setDateTime(int year,int month,int day,int hour,int minute,int second);
};


class QMyDateTimeEdit : public QDateTimeEdit
{
    Q_OBJECT
public:
    QMyDateTimeEdit(QWidget* parent=0);
public slots:
    void    updateProperty(const QString & name);
    void    timer();
    void    updatePropertyAttribute();
    void    dateTimeChanged_signals(const QDateTime &datetime);
    void    initProperty();
signals:
    void    zValueChanged();
protected:
    QTimer  *m_timer;
    QObjectHost   *m_host;
};

#endif // QMYTIMEEDIT_H
